<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!doctype html>
<html lang="zh-CN">
<head>
<meta content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" name="viewport" />
<meta charset="utf-8">
<title>击杀恶龙，赢千万宝藏</title>
<script type="text/javascript" src="./js/flexible.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jweixin-1.0.0.js"></script>
<style>
body,ol,ul,h1,h2,h3,h4,h5,h6,p,th,td,dl,dd,form,fieldset,legend,input,textarea,select{
	margin:0;
	padding:0;
}
img{
	box-sizing: border-box;
	max-width: 100%;
	height: auto;
	vertical-align: middle;
	border: 0;
}
li{
	list-style: none;
	text-align: left;
	padding-left: 5px;
}
table{
	border-collapse:collapse;
	border-spacing:0;
}
a{
	text-decoration: none;
	color: #341800;
}
.fl{
	float: left;
}
.fr{
	float: right;
}
.clearfix:before,.clearfix:after {
	display: table;
	content: " ";
	line-height: 0;
	width: 100%;
	visibility: hidden;
}

.clearfix:after {
	clear: both;
}
.tips{
	width: 9.0rem;
	height: 1.02rem;
	margin: 0 auto;
}
.calc_invest{
	color: #ff7021;
	font-size: 14px;
}
.calc_invest input{
	width: 2.08rem;
	height: 0.88rem;
	border: 1px solid #ff7021;
	text-align: center;
	color: #ff7021;
}
input::-webkit-input-placeholder{
	color: #FF7021 !important;
}
input:-moz-placeholder{
	color: #FF7021 !important;
}
input:-moz-placeholder, textarea:-moz-placeholder {
　　color: #FF7021 !important;
}
input:-ms-placeholder{
	color: #FF7021 !important;
}

.btn_gift_list{
	position: absolute;
	right: 5px;
	top: -0.8rem;
	color: #FF7021;
	border-bottom: 1px solid #FF7021;
}
.reward-list tr td{
	padding: 0.1rem 0;
	text-align: center;
	border: 1px solid #312e5a;
}
.btn-get{
	width: 1.6rem;
	height: 0.56rem;
	line-height: 0.56rem;
	background: #FF7021;
	margin: 0.1rem auto;
	border-radius: 5px;
}
.not-click{
	background: #CCC;
	color: #FF7021;
	pointer-events: none;
}

.dragon_eggs{
	width: 3.68rem;
	position: absolute;
	bottom: 1.04rem;
	left: 50%;
	margin-left: -1.84rem;
}
.hammer{
	width: 2.4rem;
	position: absolute;
	right: 1.2rem;
	top: -0.2rem;
}

.break_eggs{
	width: 7.88rem;
	position: absolute;
	bottom: 0.6rem;
	left: 50%;
	margin-left: -3.94rem;
	z-index: 9;
	display: none;
}
.eggs_reward{
	position: absolute;
	left: 50%;
	margin-left: -1.4rem;
	top: 1.28rem;
	width: 2.8rem;
	z-index: 8;
	display: none;
}
.eggs_reward_fixed{
	position: absolute;
	left: 50%;
	margin-left: -1.4rem;
	top: 1.28rem;
	width: 2.8rem;
	height: 1.307rem;
	z-index: 10;
	display: none;
}

.hit_eggs_reward{
	display: inline-block;
	width: 2.08rem;
	height: 1.36rem;
	line-height: 1.36rem;
	background: #282646;
	margin-right: 0.28rem;
	text-align: center;
}
.hit_eggs_reward:last-child{
	margin-right: 0;
}

ul.win_list li{
	height: 0.6rem;
	line-height: 0.6rem;
	padding-left: 1rem;
}
ul.win_list li>span:last-child{
	margin-left: 2.08rem
}
table.kill_dragon_reward tr:nth-child(even){
	background: #282646;
}
table.kill_dragon_reward tr:nth-child(odd){
	background: #3e3c59;
}
table.kill_dragon_reward tr td{
	height: 0.72rem;
	line-height: 0.72rem;
}

.mask{
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.6);
	display: none;
}
.pop-up{
	position: fixed;
	left: 5%;
	top: 50%;
	width: 90%;
	background: #FFF;
	z-index: 99;
    border-radius: 16px;
    text-align: center;
    display: none; 
}
.btn-sure{
    width: 3.8rem;
    height: 0.88rem;
    line-height: 0.88rem;
    margin: 0.64rem auto;
    background: #ff7021;
    color: #FFF;
    border-radius: 10px;
}
.pop-up p{
	font-size: 12px;
	line-height: 20px;
}
.btn-close{
	position: absolute;
	right: 0;
	top: 0;
	width: 30px;
	height: 30px;
	font-size: 30px;
	transform: rotate(45deg);
	text-align: center;
	line-height: 30px;
}
.rule-wrap tr td{
	line-height: 0.6rem;
}
.rule-wrap tr td:nth-child(1){
	vertical-align: top;
}

.gift_list{
	width: 90%; 
	overflow-x: hidden;
	overflow-y: auto;
	position: fixed;
	left: 5%;
	top: 50%;
	background: #FFF;
	color: #FF7021;
	border-radius: 8px;
	display: none; 
	z-index: 98;
}
.gift-number tr td {
	line-height: 30px;
}
.tab-gift tr td{
	line-height: 24px;
	text-align: center; 
	border: 1px solid #ffc3a2;
}
/* 锤子动画 */
@-webkit-keyframes hammer {
	0% {
	-webkit-transform: none;
	transform: none;
	}
	20% {
	-webkit-transform: rotate3d(0,0,1,30deg);
	transform: rotate3d(0,0,1,30deg);
	}
	100% {
	-webkit-transform: translate3d(-0.4rem,1rem,0);
	transform: translate3d(-0.4rem,1rem,0);
	}
}
@keyframes hammer {
	0% {
	-webkit-transform: none;
	transform: none;
	}
	20% {
	-webkit-transform: rotate3d(0,0,1,50deg);
	transform: rotate3d(0,0,1,50deg);
	}
	100% {
	-webkit-transform: translate3d(-0.4rem,1.2rem,0);
	transform: translate3d(-0.4rem,1.2rem,0);
	}
}
.hammer-active {
	-webkit-animation: hammer 500ms forwards;
	animation: hammer 500ms forwards;
}

/* 蛋动动画 */
@-webkit-keyframes shake {
	from, to {
	-webkit-transform: translate3d(0, 0, 0);
	transform: translate3d(0, 0, 0);
	}

	10%, 30%, 50%, 70%, 90% {
	-webkit-transform: translate3d(-10px, 0, 0);
	transform: translate3d(-10px, 0, 0);
	}

	20%, 40%, 60%, 80% {
	-webkit-transform: translate3d(10px, 0, 0);
	transform: translate3d(10px, 0, 0);
	}
}

@keyframes shake {
	from, to {
	-webkit-transform: rotate3d(0,0,0,0);
	transform: rotate3d(0,0,0,0);
	}

	10%, 30%, 50%, 70%, 90% {
	-webkit-transform: rotate3d(0,0,1,-10deg);
	transform: rotate3d(0,0,1,-10deg);
	}

	20%, 40%, 60%, 80% {
	-webkit-transform: rotate3d(0,0,1,10deg);
	transform: rotate3d(0,0,1,10deg)
	}
}
.shake {
	-webkit-animation: shake 1s 0.6s;
	animation: shake 1s 0.6s;
}

/* 领取奖品动画 */
@-webkit-keyframes getPrize{
	0%{
	 -webkit-transform: none;
	 transform: none;
	}
	20%{
	 -webkit-transform: translate3d(0,-2rem,0);
	 transform: translate3d(0,-2rem,0);
	 opacity: 1;
	}
	100%{
	 -webkit-transform: translate3d(0,4rem,0);
	 transform: translate3d(0,4rem,0);
	 opacity: 0;
	}
}
@keyframes getPrize{
	0%{
	 -webkit-transform: none;
	 transform: none;
	}
	20%{
	 -webkit-transform: translate3d(0,-2rem,0);
	 transform: translate3d(0,-2rem,0);
	 opacity: 1;
	}
	100%{
	 -webkit-transform: translate3d(0,4rem,0);
	 transform: translate3d(0,4rem,0);
	 opacity: 0;
	}
}
.get_eggs_reward{
	-webkit-animation: getPrize 2s forwards;
	animation: getPrize 2s forwards
}
</style>
</head>
<body style="background: #100e31;">
	<div class="header" style="">
		<img src="http://laicunba.b0.upaiyun.com/lcb/activity/kill_dragon_top.png" />
	</div>
	<div class="tips"><img src="img/kill_dragon_plan.png" /></div>
	<div class="clearfix nav_bar" style="width: 9.28rem;margin: 0.48rem auto;text-align: center;color: #fdfcfc;">
		<div class="fl btn_kill_dragon" style="width: 2.8rem;">
			<img src="img/btn_kill_dragon.png" />
			<div>750元京东E卡<br/>或760元现金券</div>
		</div>
		<div class="fl btn_hit_eggs" style="width: 2.8rem;margin-left: 0.44rem;">
			<img src="img/btn_hit_eggs.png" />
			<div>iPhone7</div>
		</div>
		<div class="fr btn_kill_dragon_rank" style="width: 2.8rem;">
			<img src="img/btn_kill_dragon_rank.png" />
			<div>1000元现金大奖</div>
		</div>
	</div>
	<div class="kill_dragon_scene" style="height: 5.64rem;"><img src="http://laicunba.b0.upaiyun.com/lcb/activity/kill_dragon_scene.png" /></div>
	<div class="tips" style="margin: 10px auto;"><img src="img/add_up_invest.png" /></div>
	<div class="calc_invest" style="margin-left: 0.4rem;">
		<input type="number" id="input_amount" style="width: 90px" placeholder="投资本金" />
		<span style="display: inline;margin: 0 0.2rem;">*</span>
		<input type="number" id="input_period" style="width: 50px" placeholder="天数" />
		<span style="display: inline;margin: 0 0.05rem;">/365=</span>
		<input type="number" id="compute_result" style="width: 90px" readonly="readonly" placeholder="累计年化投资额" /> 元
	</div>
	<div style="color: #d4d1fd;margin: 0.32rem 0 0.32rem 0.4rem;">计算累计年化投资额=投资本金*投资天数/365天</div>
	<div class="tips"><img src="img/kill_dragon_reward.png" /></div>
	<div style="text-align:center;color: #FF7021;font-size: 14px;position: relative;margin-top: 0.5rem;">
		<p>未领取奖励所剩累计年化投资金额：<span><c:choose><c:when test="${loginStatus == '1' }"><c:choose><c:when test="${vcoinBalance > 0 }">${vcoinBalance }</c:when><c:otherwise>0</c:otherwise></c:choose></c:when><c:otherwise>*****</c:otherwise></c:choose></span> 元</p>
		<p style="margin: 0.32rem 0;">累计屠龙血条： <span><c:choose><c:when test="${loginStatus == '1' }"><c:choose><c:when test="${killProgress > 0 }">${killProgress } %</c:when><c:otherwise>0 %</c:otherwise></c:choose></c:when><c:otherwise>***</c:otherwise></c:choose></span></p>
		<p>当前排名： <span><c:choose><c:when test="${killDragonRank > 0 }">${killDragonRank }名</c:when><c:otherwise>未上榜</c:otherwise></c:choose></span></p>
		<div class="btn_gift_list">我的礼品单</div>
	</div>
	<div style="width: 9.28rem;margin: 0.2rem auto;">
		<table class="reward-list" style="width: 100%;color: #d4d1fd;">
			<tr>
				<td>恶龙血量</td>
				<td>所需累计年化<br/>投资金额</td>
				<td colspan="2" style="vertical-align: middle;">奖励</td>
			</tr>
			<tr>
				<td>100%</td>
				<td>50000元</td>
				<td>
					<span>A、750元京东E卡</span>
					<div class="btn-get <c:if test="${vcoinBalance < 50000 }">not-click</c:if>" rel="001">领取</div>
				</td>
				<td>
					<span>B、760元现金券</span>
					<div class="btn-get <c:if test="${vcoinBalance < 50000 }">not-click</c:if>" rel="002">领取</div>
				</td>
			</tr>
			<tr>
				<td>80%</td>
				<td>25000元</td>
				<td>
					<span>A、300元京东E卡</span>
					<div class="btn-get <c:if test="${vcoinBalance < 25000 }">not-click</c:if>" rel="003">领取</div>
				</td>
				<td>
					<span>B、310元现金券</span>
					<div class="btn-get <c:if test="${vcoinBalance < 25000 }">not-click</c:if>" rel="004">领取</div>
				</td>
			</tr>
			<tr>
				<td>70%</td>
				<td>10000元</td>
				<td>
					<span>A、100元京东E卡</span>
					<div class="btn-get <c:if test="${vcoinBalance < 10000 }">not-click</c:if>" rel="005">领取</div>
				</td>
				<td>
					<span>B、110元现金券</span>
					<div class="btn-get <c:if test="${vcoinBalance < 10000 }">not-click</c:if>" rel="006">领取</div>
				</td>
			</tr>
			<tr>
				<td>60%</td>
				<td>5888元</td>
				<td>
					<span>A、50元京东E卡</span>
					<div class="btn-get <c:if test="${vcoinBalance < 5888 }">not-click</c:if>" rel="007">领取</div>
				</td>
				<td>
					<span>B、55元现金券</span>
					<div class="btn-get <c:if test="${vcoinBalance < 5888 }">not-click</c:if>" rel="008">领取</div>
				</td>
			</tr>
			<tr>
				<td>40%</td>
				<td>2200元</td>
				<td>
					<span>A、15元话费</span>
					<div class="btn-get <c:if test="${vcoinBalance < 2200 }">not-click</c:if>" rel="009">领取</div>
				</td>
				<td>
					<span>B、20元现金券</span>
					<div class="btn-get <c:if test="${vcoinBalance < 2200 }">not-click</c:if>" rel="010">领取</div>
				</td>
			</tr>
			<tr>
				<td>10%</td>
				<td>300元</td>
				<td>
					<span>A、0.5%加息券</span>
					<div class="btn-get <c:if test="${vcoinBalance < 300 }">not-click</c:if>" rel="011">领取</div>
				</td>
				<td>
					<span>B、5元现金券</span>
					<div class="btn-get <c:if test="${vcoinBalance < 300 }">not-click</c:if>" rel="012">领取</div>
				</td>
			</tr>
		</table>
		<div style="color: #d4d1fd;">小攻略：<br/>如果您只有5万本金，想获取最高奖励的话，我给您个建议，投资五万165天标的，您所获累计年化投资金额为22603元，可以获得两张100元京东E卡或者两张110元现金券和15元话费或者20元现金券和0.5%加息券或者5元现金券</div>
	</div>
	<!-- -砸龙蛋过程 - -->
	<div class="tips hit_eggs"><img src="img/hit_eggs_tips.png" /></div>
	<div style="text-align: center;color:#ff7120;font-size: 14px;">剩余砸龙蛋的机会：<span style="font-size: 20px;"><c:choose><c:when test="${loginStatus == '1' }"><c:choose><c:when test="${hitEggsChance > 0 }">${hitEggsChance } </c:when><c:otherwise>0 </c:otherwise></c:choose></c:when><c:otherwise>* </c:otherwise></c:choose></span>次</div>
	<div style="width: 100%;height: 6.88rem;background: url(http://laicunba.b0.upaiyun.com/lcb/activity/kill_dragon_hit_eggs_scene.png) no-repeat center bottom;background-size: 100%;position: relative; ">
		<div class="dragon_eggs"><img src="http://laicunba.b0.upaiyun.com/lcb/activity/kill_dragon_eggs.png" /></div><!-- - 未砸的龙蛋 - -->
		<div class="hammer" rel="013"><img src="http://laicunba.b0.upaiyun.com/lcb/activity/kill_dragon_hammer.png" /></div> <!-- - 锤子 - -->
		<div class="break_eggs"><img src="http://laicunba.b0.upaiyun.com/lcb/activity/kill_dragon_break_eggs.png" /></div> <!-- - 龙蛋碎开之后 - -->
		<div class="eggs_reward" style=""></div><!-- - 奖品 - -->
		<div class="eggs_reward_fixed"></div>
	</div>
	<div style="width: 9.2rem;margin: 0.48rem auto 0.36rem;">
		<div class="hit_eggs_reward"><img src="img/cash10.png" style="width: 1.82rem;" />
		</div><div class="hit_eggs_reward"><img src="img/rate0.3.png" style="width: 1.6rem;" />
		</div><div class="hit_eggs_reward"><img src="img/iphone7.png" style="width: 0.8rem;" />
		</div><div class="hit_eggs_reward"><img src="img/iqiyi.png" style="width: 1.47rem;" /></div>
	</div>
	<div style="width: 9.2rem;height: 2.68rem;margin: 0.36rem auto 0.52rem;background: #282646;color: #d4d1fd;padding-top: 0.28rem;">
		<div class="scroll_list" style="height: 2.4rem;overflow: hidden;">
			<ul class="win_list">
				<c:choose>
					<c:when test="${actJoinList != null && fn:length(actJoinList) > 0 }">
						<c:forEach items="${actJoinList }" var="actJoin">
							<li>恭喜${fn:substring(actJoin.mobile, 0, 3)}****${fn:substring(actJoin.mobile, 7, 11)}<span>获得<c:choose><c:when test="${actJoin.reward_resp == 'A' }"> 10元现金券</c:when><c:when test="${actJoin.reward_resp == 'B' }"> 5元现金券</c:when><c:when test="${actJoin.reward_resp == 'C' }"> 0.3%加息券</c:when><c:when test="${actJoin.reward_resp == 'D' }"> 0.1%加息券</c:when><c:when test="${actJoin.reward_resp == 'E' }"> 爱奇艺会员VIP</c:when><c:when test="${actJoin.reward_resp == 'F' }"> iPhone7</c:when><c:otherwise> </c:otherwise></c:choose></span></li>
						</c:forEach>
					</c:when>
					<c:otherwise>
						<li style="text-align: center;">暂无英雄获得龙蛋奖励</li>
					</c:otherwise>
				</c:choose>
			</ul>
		 </div>
	</div>
	<div class="tips kill_dragon_rank"><img src="img/kill_dragon_rank.png" /></div>
	<div style="width: 9.2rem;margin: 0.52rem auto;">
		<table class="kill_dragon_reward" style="width: 100%;text-align: center;color: #d4d1fd;">
			<tr>
				<td>排名</td>
				<td>奖金</td>
			</tr>
			<tr>
				<td>1</td>
				<td>1000</td>
			</tr>
			<tr>
				<td>2</td>
				<td>800</td>
			</tr>
			<tr>
				<td>3</td>
				<td>500</td>
			</tr>
			<tr>
				<td>4</td>
				<td>200</td>
			</tr>
			<tr>
				<td>5</td>
				<td>100</td>
			</tr>
		</table>
	</div>
	<!-- - 活动规则 - -->
	<div class="tips"><img src="img/kill_dragon_rule.png"></div>
	<table class="rule-wrap" style="width: 9.4rem;margin: 0.48rem auto;color: #d4d1fd;font-size: 14px;">
		<tr>
			<td>1、</td>
			<td>活动时间为2017年4月24日10:00整-2017年5月8日23:59分整；</td>
		</tr>
		<tr>
			<td>2、</td>
			<td>根据累计年化投资金额，可获得相对应二选一的奖品，获取奖励后，减少相应的年化投资金额重新计算；</td>
		</tr>
		<tr>
			<td>3、</td>
			<td>砸龙蛋所需条件：每日领取恶龙奖励，可获得一次机会（仅限一次），邀请好友首投可获得一次机会（无上限），砸龙蛋机会仅限当日，隔日清零。活动100%中奖，加息券0.1%、加息券0.3%、红包5元、红包10元、iPhone7、一个月爱奇艺会员VIP随机砸取；</td>
		</tr>
		<tr>
			<td>4、</td>
			<td>活动期间内完成将恶龙击败至百分比血条次数最多者按照优先级排列，如相同击败数量则按照先后击败数量排名，前5名将获得对应奖励；</td>
		</tr>
		<tr>
			<td>5、</td>
			<td>本次活动获取的加息券、现金券将发送到您的账户中，可在“来存吧”APP中，我的-我的红包中查看，“京东E卡、爱奇艺会员以及iPhone7”将在本次活动结束五天内发出；</td>
		</tr>
		<tr>
			<td>6、</td>
			<td>本次活动获取的话费将在活动结束五天内充值到您注册来存吧平台的手机号上；</td>
		</tr>
		<tr>
			<td>7、</td>
			<td>新手宝和随存宝不参与本次活动，活动仅限银票宝大于15天以上的理财产品。</td>
		</tr>
	</table>
	<div style="text-align: center;margin: 1rem 0;color: #d4d1fd;">本次活动最终解释权归来存吧所有<br/>如有疑问请联系客服热线400-6191-520</div>
	<div class="mask"></div>
	<div class="pop-up">
	     <div><img src="img/popup-header.png"></div>
	     <p id="pop-title" style="color: red;font-size: 16px;">抱歉！</p>
	     <p id="pop-content" style="margin-top: 0.28rem;">您未获取到该奖励!</p>
	     <div class="btn-sure" style="">确定</div>
	</div>
	<div class="gift_list">
		<div style="margin: 0.5rem auto 0.2rem;"><img src="img/my_gift.png" /></div>
		<table class="gift-number" style="width: 90%;margin: 0 auto;">
			<tr>
				<td>京东E卡：<c:choose><c:when test="${jdECardCount > 0 }">${jdECardCount }</c:when><c:otherwise>0</c:otherwise></c:choose>个</td>
				<td>红包：<c:choose><c:when test="${redPackageCount > 0 }">${redPackageCount }</c:when><c:otherwise>0</c:otherwise></c:choose>个</td>
			</tr>
			<tr>
				<td>话 　费：<c:choose><c:when test="${phoneFeeCount > 0 }">${phoneFeeCount }</c:when><c:otherwise>0</c:otherwise></c:choose>元</td>
				<td>爱奇艺会员VIP：0个月</td>
			</tr>
			<tr>
				<td>iPhone7：0个</td>
				<td></td>
			</tr>
		</table>
		<div style="margin: 0.5rem auto 0.2rem;"><img src="img/gift_detail.png" /></div>
		<div style="width:90%;margin: 0 auto 1rem;max-height: 201px;overflow: auto;">
			<table class="tab-gift" style="width: 100%;">
				<tr>
					<td>礼品名称</td>
					<td>获取时间</td>
					<td>获取状态</td>
				</tr>
				<c:choose>
					<c:when test="${myActJoinList != null && fn:length(myActJoinList) > 0 }">
						<c:forEach items="${myActJoinList }" var="myActJoin">
							<tr>
								<td><c:choose><c:when test="${myActJoin.reward_resp == 'A' }">10元现金券</c:when><c:when test="${myActJoin.reward_resp == 'B' }">5元现金券</c:when><c:when test="${myActJoin.reward_resp == 'C' }">0.3%加息券</c:when><c:when test="${myActJoin.reward_resp == 'D' }">0.1%加息券</c:when><c:when test="${myActJoin.reward_resp != null && myActJoin.reward_resp != '' }">${fn:substring(myActJoin.reward_resp, 9, fn:length(myActJoin.reward_resp))}</c:when></c:choose></td>
								<td><fmt:formatDate value="${myActJoin.gmt_create }" pattern="yyyy.MM.dd HH:mm"/></td>
								<td><c:choose><c:when test="${myActJoin.status == 'success' }">已发放</c:when><c:when test="${myActJoin.status == 'new' }">派发中</c:when><c:otherwise>未发放</c:otherwise></c:choose></td>
							</tr>
						</c:forEach>
					</c:when>
					<c:otherwise>
						<tr>
							<td colspan="3">暂未获得活动礼品</td>
						</tr>
					</c:otherwise>
				</c:choose>
			</table>
		</div>
		<div class="btn-close">+</div>
	</div>
	<script type="text/javascript" src="./js/jquery.min.js"></script>
	<script type="text/javascript" src="activity.js"></script>
	<script type="text/javascript">
	$(function(){
		// 砸蛋奖品自动滚动列表 
		var $win=$(".scroll_list");
		var scrollTimer;
		$win.hover(function() {
			clearInterval(scrollTimer);
		}, function() {
			scrollTimer = setInterval(function() {
				scrollList($win);
			}, 1500);
		}).trigger("mouseleave"); 
		
		function scrollList(obj){
			//console.log("我动了")
			var $rollList=obj.find("ul.win_list");
			var lineHeight=$rollList.find("li:first").height();
			$rollList.animate({"marginTop": -lineHeight + "px" },600,function() {
				$rollList.css({
					marginTop: 0
				}).find("li:first").appendTo($rollList);
			})
		};
		
		// 点击三个按钮页面分别移动至相应位置
		var header = $(".kill_dragon_scene").height();
		var killDragon = $(".kill_dragon_scene").offset().top;
		var hitEggs = $(".hit_eggs").offset().top;
		var killRank = $(".kill_dragon_rank").offset().top;
		$(".btn_kill_dragon").click(function(){
			$("html,body").animate({scrollTop: killDragon},800);
		});
		$(".btn_hit_eggs").click(function(){
			$("html,body").animate({scrollTop: hitEggs},800);
		});
		$(".btn_kill_dragon_rank").click(function(){
			$("html,body").animate({scrollTop: killRank},800);
		});
		
		$(".btn-close,.btn-sure").click(function(){
			window.location.reload();
// 			$(".pop-up,.mask,.gift_list").hide();
		});
		var popupHeight = $(".pop-up").height();
		$(".pop-up").css({
			"marginTop": "-" + popupHeight/2 + "px"
		});
		$(".btn_gift_list").click(function(){
			var device = '${param.device}';
			var app_token = '${param.app_token}';
			var param = {
				t :new Date(),
				app_token:app_token
			};
			$.post("kill_dragon_login_status.htm", param, function(data) {
				if(data.loginStatus == 1) {
					$(".gift_list,.mask").show();
				} else {
					if(device) {
						window.location.href="/h5/ext/activity/kill_the_dragon.htm?device=app&app_view=login";
					} else {
						window.location.href="/h5/login.htm?tab=account&returnUrl=/h5/ext/activity/kill_the_dragon.htm";
					}
				}
			}, "json");
		});
		
		//砸蛋动画过程：
		$(".hammer").click(function(){
			var hitEggsChance = "${hitEggsChance}";
			if(hitEggsChance > 0) {
				$(this).addClass("hammer-active");
				$(".dragon_eggs").addClass("shake").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
					$(this).removeClass("shake");
					$(this).hide();
					$(".hammer").hide();
					$(".hammer").removeClass("hammer-active");

					$(".break_eggs,.eggs_reward,.eggs_reward_fixed").show();
				});
			}
		});
		//领取砸龙蛋获得的奖品
		$(".eggs_reward_fixed").click(function(){
			$(".eggs_reward").addClass("get_eggs_reward").one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend',function(){
				$(".hammer,.dragon_eggs").show();
				$(".break_eggs,.eggs_reward,.eggs_reward_fixed").hide();
				$(this).removeClass("get_eggs_reward");
				
// 				$("#pop-title").html("您好，恭喜您获得龙蛋奖励！");
//   			$("#pop-content").html('请在“我的-我的红包”中查看！ ');
  				$(".pop-up,.mask").show();
			});
		});
		
		// 我的礼品单 
		var giftlistHeight = $(".gift_list").height();
		console.log(giftlistHeight);
		$(".gift_list").css({
			marginTop: "-" + giftlistHeight/2 +"px"
		});
		
		$("input[type='number']").keyup(function() {
			if($("#input_amount").val() && $("#input_period").val()) {
				var input_amount = $("#input_amount").val();
				var input_period = $("#input_period").val();
				$("#compute_result").val(Math.round(input_amount * input_period / 365));
			} else {
				$("#compute_result").val("");
			}
		});
		
		Activity.ready('${param.app_token}', "20170424", "", {
			t:new Date()
		}, function(data){
			$(".btn-get,.hammer").click(function(){
				var _index = Number($(this).attr("rel"));
				var device = '${param.device}';
				var app_token = '${param.app_token}';
				var param = {
					t :new Date(),
					app_token:app_token
				};
				Activity.join($(this).attr("rel"), {
					defid: 'killdragon' + _index
				}, function(jdata){
					if(jdata.code=="SUCCESS"){
						switch(_index){
							case 1: 
								$("#pop-title").html("您好，恭喜您获得750元京东E卡！");
				  				$("#pop-content").html('礼物将在活动结束后五天内以短信形式<br/>发放到您注册的手机号中，请注意查收！');
				  				$(".pop-up,.mask").show();
								break;
							case 2: 
								$("#pop-title").html("您好，恭喜您获得760元现金券！");
				  				$("#pop-content").html('请在“我的-我的红包”中查看！ ');
				  				$(".pop-up,.mask").show();
								break;
							case 3: 
								$("#pop-title").html("您好，恭喜您获得300元京东E卡！");
				  				$("#pop-content").html('礼物将在活动结束后五天内以短信形式<br/>发放到您注册的手机号中，请注意查收！');
				  				$(".pop-up,.mask").show();
								break;
							case 4: 
								$("#pop-title").html("您好，恭喜您获得310元现金券！");
				  				$("#pop-content").html('请在“我的-我的红包”中查看！ ');
				  				$(".pop-up,.mask").show();
								break;
							case 5: 
								$("#pop-title").html("您好，恭喜您获得100元京东E卡！");
				  				$("#pop-content").html('礼物将在活动结束后五天内以短信形式<br/>发放到您注册的手机号中，请注意查收！');
				  				$(".pop-up,.mask").show();
								break;
							case 6: 
								$("#pop-title").html("您好，恭喜您获得110元现金券！");
				  				$("#pop-content").html('请在“我的-我的红包”中查看！ ');
				  				$(".pop-up,.mask").show();
								break;
							case 7: 
								$("#pop-title").html("您好，恭喜您获得50元京东E卡！");
				  				$("#pop-content").html('礼物将在活动结束后五天内以短信形式<br/>发放到您注册的手机号中，请注意查收！');
				  				$(".pop-up,.mask").show();
								break;
							case 8: 
								$("#pop-title").html("您好，恭喜您获得55元现金券！");
				  				$("#pop-content").html('请在“我的-我的红包”中查看！ ');
				  				$(".pop-up,.mask").show();
								break;
							case 9: 
								$("#pop-title").html("您好，恭喜您获得15元话费！");
				  				$("#pop-content").html('话费将在5天内充值到您注册的<br/>手机号中，请注意查收！');
				  				$(".pop-up,.mask").show();
								break;
							case 10: 
								$("#pop-title").html("您好，恭喜您获得20元现金券！");
				  				$("#pop-content").html('请在“我的-我的红包”中查看！ ');
				  				$(".pop-up,.mask").show();
								break;
							case 11: 
								$("#pop-title").html("您好，恭喜您获得0.5%加息券！");
				  				$("#pop-content").html('请在“我的-我的红包”中查看！ ');
				  				$(".pop-up,.mask").show();
								break;
							case 12: 
								$("#pop-title").html("您好，恭喜您获得5元现金券！");
				  				$("#pop-content").html('请在“我的-我的红包”中查看！ ');
				  				$(".pop-up,.mask").show();
								break;
							case 13: 
								if(jdata.join_resp == "A") {
									$(".eggs_reward").html('<img src="img/cash10-a.png" />');
									$("#pop-title").html("您好，恭喜您获得10元现金券！");
					  				$("#pop-content").html('请在“我的-我的红包”中查看！ ');
								} else if(jdata.join_resp == "B") {
									$(".eggs_reward").html('<img src="img/cash5-c.png" />');
									$("#pop-title").html("您好，恭喜您获得5元现金券！");
					  				$("#pop-content").html('请在“我的-我的红包”中查看！ ');
								} else if(jdata.join_resp == "C") {
									$(".eggs_reward").html('<img src="img/rate0.3-a.png" />');
									$("#pop-title").html("您好，恭喜您获得0.3%元加息券！");
					  				$("#pop-content").html('请在“我的-我的红包”中查看！ ');
								} else if(jdata.join_resp == "D") {
									$(".eggs_reward").html('<img src="img/rate0.1-a.png" />');
									$("#pop-title").html("您好，恭喜您获得0.1%元加息券！");
					  				$("#pop-content").html('请在“我的-我的红包”中查看！ ');
								}
								break;
						};
					}else if(jdata.code=="token_error"){
						if(!device){
							console.log("h5 login");
							window.location.href="/h5/login.htm?tab=account&returnUrl=/h5/ext/activity/kill_the_dragon.htm";
						}else{
							console.log("app login");
							window.location.href="/h5/ext/activity/kill_the_dragon.htm?device=app&app_view=login";
						}
					}else if(jdata.code=="HAS_NO_CHANGE"){
						$("#pop-title").html("抱歉！");
		  				$("#pop-content").html("您没有砸龙蛋机会了,<br/>快快去邀请好友投资吧！");
		  				$(".pop-up,.mask").show();
					}else if(jdata.code=="ACT_TIME_INVALID" || jdata.code=="ACTIVITYDO_NOT_EXIST"){
		  				$("#pop-title").html("抱歉！");
		  				$("#pop-content").html("活动未开始");
		  				$(".pop-up,.mask").show();
					}else{
		  				console.log("参加活动失败："+JSON.stringify(jdata));
					}
				});
			});
		});
	})
	</script>
</body>
</html>